﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<!--这meta的作用就是删除默认的苹果工具栏和菜单栏。-->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<!--在web app应用下状态条（屏幕顶部条）的颜色-->
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<!--该标签用于指定是否将网页内容中的手机号码显示为拨号的超链接。-->
<meta name="format-detection" content="telephone=no"/>
<!--网页在任何时候都不能被Cache存储-->
<meta http-equiv="Expires" content="-1"/>
<!--清除缓存-->
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Pragma" content="no-cache"/>
<title></title>
<link href="${ctx}/static/newweb/css/reply.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/static/newweb/css/top.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/static/newweb/css/footer.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="${ctx}/static/newweb/js/zepto.min.js"></script>
<script language="javascript" type="text/javascript" src="${ctx}/static/newweb/js/dropload.min.js"></script>
<script src="${ctx}/static/newweb/js/mdialog.js"></script>
<link href="${ctx}/static/newweb/css/dropload.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/newweb/css/mdialog.css"/>
<script src="${ctx}/static/newweb/js/main.js"></script>
<link rel="stylesheet" href="${ctx}/static/newweb/css/reset.css"/>
<link rel="stylesheet" href="${ctx}/static/newweb/css/style.css"/>
<script language="javascript" type="text/jscript">
function home(mid){
	window.location="${ctx}/wechatapi/personal?mid="+mid;
}
function del(){
	 $('.cd-popup').addClass('is-visible');
}
function ok(){
  $('.cd-popup').removeClass('is-visible');
  window.location='${ctx}/wechatapi/delReply?id=${faq.id}';
}
function not(){
  $('.cd-popup').removeClass('is-visible');
}
//点赞
function follow(){
	var fid = ${faq.id};
	var sum = $("#praise").html();
	$.ajax({
		type: 'POST',
		url: '${ctx}/wechatapi/praise',
		dataType: 'json',
		data:{
			id:fid,
			num:sum
		},
		success: function(data){
			new TipBox({
				type:'success',
				str:'操作成功',
				hasBtn:false,
				setTime:1000,
				callBack:function(){
					$("#praise").html(data);
					$("#wgz1").css('display','block');
					$("#gz1").css('display','none');
				}
			});
		}
	});	
}

//取消点赞
function nofollow(){
	var fid = ${faq.id};
	var sum = $("#praise").html();
	$.ajax({
		type: 'POST',
		url: '${ctx}/wechatapi/noPraise',
		dataType: 'json',
		data:{
			id:fid,
			num:sum
		},
		success: function(data){
			new TipBox({
				type:'success',
				str:'操作成功',
				hasBtn:false,
				setTime:1000,
				callBack:function(){
					$("#praise").html(data);
					$("#wgz1").css('display','none');
					$("#gz1").css('display','block');
				}
			});
		}
	});	
}
//收藏
function collection(){
	var fid = ${faq.id};
	var sum = $("#collections").html();
	$.ajax({
		type: 'POST',
		url: '${ctx}/wechatapi/collection',
		dataType: 'json',
		data:{
			id:fid,
			num:sum
		},
		success: function(data){
			new TipBox({
				type:'success',
				str:'操作成功',
				hasBtn:false,
				setTime:1000,
				callBack:function(){
					$("#collections").html(data);
					$("#wgz2").css('display','block');
					$("#gz2").css('display','none');
				}
			});
		}
	});	
}

//取消收藏
function nocollection(){
	var fid = ${faq.id};
	var sum = $("#collections").html();
	$.ajax({
		type: 'POST',
		url: '${ctx}/wechatapi/noCollection',
		dataType: 'json',
		data:{
			id:fid,
			num:sum
		},
		success: function(data){
			new TipBox({
				type:'success',
				str:'操作成功',
				hasBtn:false,
				setTime:1000,
				callBack:function(){
					$("#collections").html(data);
					$("#wgz2").css('display','none');
					$("#gz2").css('display','block');
				}
			});
		}
	});	
}
</script>
</head>

<body>
<div class="top">回复
</div>
<%
  if (session.member.headimgurl == null){
%>
<img class="topone" src="${ctx}/static/newweb/img/wechat.png" onclick="home('${session.member.id}')"/>
<%
  }else{
%>
<img class="topone" src="${session.member.headimgurl!}46" onclick="home('${session.member.id}')"/>
<%
  }
%>
<div class="topbox"></div>
<div class="wt">${title!}</div>
<div class="main">
    <div class="gr">
<%
  if (faq.img == null){
%>
<img src="${ctx}/static/newweb/img/wechat.png" />
<%
 }else{
%>
<img src="${faq.img!}46" />
<%}%>
            <span class="xm">${faq.nickname!}</span>
            <span class="gx">${faq.autograph!}</span>
    </div>
</div>
<div class="main">
   <div class="gn">
        <img src="${ctx}/static/newweb/img/shoucang.png" />
        <span id="collections">${faq.collections!}</span>
        <img src="${ctx}/static/newweb/img/dianzan.png" />
        <span id="praise">${faq.praise!}</span>
   </div>
   <div class="kz">
   <%
      if (ishave==1){
   %>   
        <img src="${ctx}/static/newweb/img/shanchu.png"  onclick="del()"/>
        <img src="${ctx}/static/newweb/img/shuxie.png"  onclick="toedit()"/>
   <%
     }
   %>
   </div> 
    <p>
    <%
      if (faq.content != null){
    %>
    ${strutil.replace(faq.content,'\n','<br/>')}
    <%
      }
    %>    
    </p>
  <div class="bs"></div>
    
  <div class="ans">
    <div class="gg">    
      <span class="wgz" id="wgz1" onclick="nofollow()">取消点赞</span>
      <span class="ggx"  id="gz1" onclick="follow()">点赞</span>
    </div>
    <div class="gg">    
      <span class="wgz" id="wgz2" onclick="nocollection()">取消收藏</span>
      <span class="ggx" id="gz2" onclick="collection()">收藏</span>
    </div>
  </div>
  <div class="clearfix"></div>
</div>
  

<div class="bottom"></div>
<div class="footer">
    <a href="${ctx}/wechatapi/portal" class="footerl"><img src="${ctx}/static/newweb/img/zhuye.png" /></a>
    <a href="${ctx}/wechatapi/search" class="footerr"><img src="${ctx}/static/newweb/img/sousuo.png" /></a>
</div>
<div class="fix">
<a href="${ctx}/wechatapi/ask">问</a>

</div>
<script language="javascript" type="text/jscript">
function toedit(){
	window.location='${ctx}/wechatapi/toEditReply?id=${faq.id!}';
}
$(function(){
	if (${praise} == 1){
		$("#wgz1").css('display','block');
		$("#gz1").css('display','none');
	}else{
		$("#wgz1").css('display','none');
		$("#gz1").css('display','block');		
	}
	if (${collection} == 1){
		$("#wgz2").css('display','block');
		$("#gz2").css('display','none');
	}else{
		$("#wgz2").css('display','none');
		$("#gz2").css('display','block');		
	}
});
</script>
<div class="cd-popup" role="alert">
	<div class="cd-popup-container">
		<p>你确定你要删除这个回复吗?</p>
		<ul class="cd-buttons">
			<li><a href="#" onclick="ok()">是</a></li>
			<li><a href="#" onclick="not()">否</a></li>
		</ul>
		<a href="#" class="cd-popup-close img-replace">关闭</a>
	</div> <!-- cd-popup-container -->
</div> <!-- cd-popup -->
</body>
</html>
